home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / source / snip9503 / modemio.h < prev    next >
C/C++ Source or Header  |  1995-03-14  |  3KB  |  93 lines

  1. /*                                           */
  2. /* This source is released to the Public     */
  3. /* domain on December 16, 1992.              */
  4. /*                                           */
  5. /* Curtis Paris                              */
  6. /* Internet: cparis@comtch.spk.wa.usa        */
  7. /*                                           */
  8.  
  9. #define MAX_BUFFER 1024 /* Max Input Buffer */
  10.  
  11. #define I8088_IMR  0x21
  12. #define XON        0x11
  13. #define XOFF       0x13
  14.  
  15. #ifdef MODEMIO_INIT
  16.  
  17. #if defined(__SC__)     /* Note: Won't work with older versions of SC/ZTC */
  18.  #include <int.h>
  19.  #define INT_ON         int_on
  20.  #define INT_OFF        int_off
  21.  #define GETVECT        _dos_getvect
  22.  #define SETVECT        _dos_setvect
  23. #elif defined(__TURBOC__)
  24.  #define INT_ON         enable
  25.  #define INT_OFF        disable
  26. #else /* assume MSC/QC or compatible */
  27.  #include <conio.h>
  28.  #define INT_ON         _enable
  29.  #define INT_OFF        _disable
  30.  #define GETVECT        _dos_getvect
  31.  #define SETVECT        _dos_setvect
  32. #endif
  33.  
  34. /*** Modem Buffer Information ***/
  35. int           modem_buffer_count=0;
  36. unsigned char modem_buffer[MAX_BUFFER];
  37. int           modem_buffer_head=0,
  38.               modem_buffer_tail=0;
  39.  
  40. /*** Misc. Modem Status Information ***/
  41. int modem_rts_cts=1;   /* RTS/CTS variable 0=Off, 1=On */
  42. int modem_xon_xoff=1;  /* XON/XOFF variable 0=off, 1=on */
  43. int modem_open=0;      /* IS the port open variable, do not change */
  44. int modem_port=0;      /* What port is it on, 1-5 */
  45. int modem_base=0;      /* The ports BASE address */
  46. int modem_irq =0;      /* The IRQ */
  47. int modem_vect=0;      /* The Interupt Vector */
  48. int modem_overflow=0;  /* Modem Overflow Alert */
  49. int modem_pause=0;     /* Is it paused for XON/XOFF */
  50.  
  51. /*** Old Port Interupt Holders ***/
  52. int old_modem_lcr, old_modem_imr,
  53.     old_modem_ier, old_modem_status;
  54.  
  55. #else
  56.  
  57. /*** Modem Buffer Information ***/
  58. extern int           modem_buffer_count;
  59. extern unsigned char modem_buffer[MAX_BUFFER];
  60. extern int           modem_buffer_head,
  61.                      modem_buffer_tail;
  62.  
  63. /*** Misc. Modem Status Information ***/
  64. extern int modem_rts_cts;
  65. extern int modem_xon_xoff;
  66. extern int modem_open;
  67. extern int modem_port;
  68. extern int modem_base;
  69. extern int modem_vect;
  70. extern int modem_overflow;
  71. extern int modem_pause;
  72.  
  73. /*** Old Port Interupt Holders ***/
  74. extern int old_modem_lcr, old_modem_imr,
  75.        old_modem_ier, old_modem_status;
  76.  
  77. #endif
  78.  
  79. int com_carrier(void);
  80.  
  81. int com_ch_ready(void);
  82. unsigned char com_read_ch(void);
  83. void com_send_ch(unsigned char ch);
  84.  
  85. void com_parity(char p);
  86. void com_data_bits(unsigned char bits);
  87. void com_stop_bits(unsigned char bits);
  88. void com_speed(long speed);
  89.  
  90. int com_open(int comport, long speed, int data_bit, unsigned char parity,
  91.       unsigned char stop_bit);
  92. void com_close(void);
  93.